home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / perlnt.zip / regupdat < prev    next >
Text File  |  1993-07-25  |  2KB  |  67 lines

  1. #
  2. # Perl script to update the NT registry with defaults for Perl
  3. #
  4.  
  5. die "usage: perl regupdat <perl installation path>\n" 
  6.     if (@ARGV != 1);
  7.  
  8. $installdir = shift;
  9.  
  10. #
  11. # note: if you change this, change it in the perl source so perl knows
  12. #       where to look!
  13. #
  14. $basekey = "SOFTWARE\\Intergraph\\Perl\\4.036";
  15.  
  16. print "Starting Registry update for installation directory $installdir\n";
  17.  
  18. #
  19. # open a key for installing perl
  20. #
  21.  
  22. &RegCreateKey($HKEY_LOCAL_MACHINE, 
  23.           $basekey, $key) ||
  24.     do {
  25.     print "cant open registry: $!\n";
  26.     sleep (10);
  27.     die "Can't HKEY_LOCAL_MACHINE\\SOFTWARE\\Intergraph\\Perl\\4.036: $!";
  28.     };
  29.  
  30. &RegSetValueEx ($key, "PathName", 0, $REG_SZ, "$installdir\\bin\\perl.exe");
  31. &RegSetValueEx ($key, "SoftwareType", 0, $REG_DWORD, 1);
  32. &RegCloseKey ($key);
  33.  
  34. &RegCreateKey($HKEY_LOCAL_MACHINE, 
  35.           "$basekey\\Parameters", $key) ||
  36.     do {
  37.     print "can't update parameters: $!\n";
  38.     sleep(10);
  39.     die "Can't HKEY_LOCAL_MACHINE\\$basekey\\Parameters: $!";
  40.     };
  41.  
  42. &RegSetValueEx ($key, "BIN", 0, $REG_SZ, "$installdir\\bin");
  43. &RegSetValueEx ($key, "PRIVLIB", 0, $REG_SZ, "$installdir\\lib");
  44. &RegCloseKey ($key);
  45.  
  46. &RegCreateKey($HKEY_LOCAL_MACHINE, 
  47.           "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment",
  48.           $key) ||
  49.     do {
  50.     print "can't get environment key: $!\n";
  51.     sleep(10);
  52.     die "Can't get environment value: $!\n";
  53.     };
  54.  
  55. &RegQueryValueEx ($key, "Path", 0, $type, $path) 
  56.     || die "can't get path value:$!\n";
  57.  
  58. &RegSetValueEx ($key, "Path", 0, $type, "$installdir;$path")
  59.     || die "can't set path to $idir;$path:$!\n";
  60.  
  61. &RegCloseKey($key);
  62.  
  63.  
  64. print "Finished with registry update\n";
  65. sleep (2);
  66.  
  67.